#pragma once


#include <string>
#include <set>
#include <functional>
#include "Singleton.h"
#include "MsgRouter.h"
#include "3400_api_order.pb.h"

#define  MOD_UID (100)

class ApiOrderService
{
public:
    bool Init();

public:
    ApiOrderService() = default;
    virtual ~ApiOrderService() = default;

public:
    static ApiOrderService* Instance()
	{
		return CSingleton<ApiOrderService>::Instance();
	}

protected:
	void OnBetAndWin(api_order::ApiOrder& api_order);
	void OnBet(api_order::ApiOrder& api_order);
	void OnWin(api_order::ApiOrder& api_order);
	void OnCancleBet(api_order::ApiOrder& api_order);
	void OnCancleBetAndWin(api_order::ApiOrder& api_order);
	void OnReward(api_order::ApiOrder& api_order);

protected:
    void PushApiOrderCreate(api_order::ApiOrder& api_order);
    void PushApiOrderFinish(api_order::ApiOrder& api_order);
	int pushToMq(const unsigned int uid, const api_order::ApiOrder& api_order);
public:
    void OnApiOrderUpdate(api_order::ApiOrder& api_order);
};















